import httpRequest from '@/utils/httpRequest'
import constant from '../constant'

export function pageList (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/page',
    method: 'post',
    data: data
  })
}
export function pageItems (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/pageItems',
    method: 'post',
    data: data
  })
}
export function entityList (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/list',
    method: 'post',
    data: data
  })
}
export function entityItemList (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/listItem',
    method: 'post',
    data: data
  })
}
export function getEntityMethod (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getEntityMethod',
    method: 'post',
    data: data
  })
}
export function getActionMethodName (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getActionMethodName',
    method: 'post',
    data: data
  })
}

export function saveOrUpdate (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/save',
    method: 'post',
    data: data
  })
}

export function delItem (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/delItem',
    method: 'post',
    data: data
  })
}

export function getInfo (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/get',
    method: 'post',
    data: data
  })
}
export function getEntitys (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getEntitys',
    method: 'post',
    data: data
  })
}
export function getEntityProperties (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getEntityProperties',
    method: 'post',
    data: data
  })
}
export function sycnEntityData (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/sycnEntityData', 
    method: 'post',
    data: data
  })
}
export function sycnByEntity (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/sycnByEntity',
    method: 'post',
    data: data
  })
}
export function getEntityByItemID (data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getEntityByItemID',
    method: 'post',
    data: data
  })
}
// 获取因子名称
export function getitemNames(data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getEntityItems',
    method: 'post',
    data: data
  })
}
// 获取方法
export function getmethods(data) {
  return httpRequest({
    url: constant.DR + '/rule/entity/getActionMethodName',
    method: 'post',
    data: data
  })
}

